package com.bytecode.javassist;

import com.sun.tools.attach.AgentInitializationException;
import com.sun.tools.attach.AgentLoadException;
import com.sun.tools.attach.AttachNotSupportedException;
import com.sun.tools.attach.VirtualMachine;

import java.io.IOException;

/**
 * 描述:
 *
 * @author luzhongfu
 * Created by lucky on 2020-07-02 2:22 PM
 */
public class Attacher {

    public static void main(String[] args) throws IOException, AttachNotSupportedException, AgentLoadException, AgentInitializationException {
        VirtualMachine attach = VirtualMachine.attach("5207");
        attach.loadAgent("/Users/luzhongfu/javassist/agent-1.0-SNAPSHOT.jar");

    }
}
